home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Presen…rary 5 (Internal Edition)
/
Apple R&P Lib Internal v5.0.iso
/
6-Developer Demos
/
Developer Demos-Gen.
/
America Online Demo
/
Online Files
/
Online CCL
/
Online CCL.rsrc
/
AOcl_502_Datapac
< prev
next >
Wrap
Text File
|
1989-09-25
|
8KB
|
286 lines
!-------------------------------------------------------------------
! DATAPAC.ALCL
! By: David Steinberg
! Phone = (416) 357-2770 (Canada - 1200 baud)
! (604) 662-7732 (Canada - 2400 baud)
!
! Date: June 20, 1989
! Rev: 5.00
! Changed 9/18/89 by DMC to request Hayes extended commandset
! Changed 9/19/89 by DMC to report error codes,
! and report busy signal as a seperate error
!---------------------------------------------------------------------
!
! Connect Sequence:
!
-LABEL 0
Revision 5
DsplyMsg Initializing modem.
CanBtn 19 { if cancel button - just exit }
SetTries 0
ChrDelay 2
SerReset ~BAUD 0 8 1
HSReset 0 0 17 19
DsplyPic 1
!
!---------------------------------------------------------------------
!
-LABEL 1 { wake up the modem }
Flush
!
MatchStr 1 2 +++ { In case we match dont wait for the full time}
MatchStr 2 2 OK
MatchStr 3 2 > { Special case for Avatex 1200 modems}
Xmit +++ { Get the modems attention}
Wait 200 { Pause for 2 seconds, minimum gap required}
!
-Label 2
MatchStr 1 3 OK
MatchStr 2 33 NO { Cant hangup}
MatchStr 3 33 ERROR { Command error}
MatchStr 4 3 > { Special case for Avatex 1200 modems}
!
Pause 40 { Allow modem to settle between commands.}
Xmit ATZ\13
! { jump to label #3 if we see 'OK' go by }
Wait 200 { wait for 'OK' from modem - fall thru if timeout }
Jump 33 { Exit stage left...time out error on modem.}
!
!------------------------------------------------------------------
!
-LABEL 3 { just saw 'OK'-Set modem to x1 }
!
MatchStr 1 4 OK
MatchStr 2 4 ERROR {We don't care what we get for this one}
!
Pause 40 { Allow modem to settle between commands.}
Xmit ATE1Q0X1\13
!
!------------------------------------------------------------------
-LABEL 4 { Now try to dial }
DsplyMsg Dialing ~FONE
!
MatchStr 1 5 CONNECT\13
MatchStr 2 5 CONNECT 300
MatchStr 3 6 CONNECT 1200
MatchStr 4 12 CONNECT 2400 {If there using an MNP modem at dial at say 9600 and connect}
MatchStr 5 12 CONNECT 4800 {at 1200/300 then there screwed for now.}
MatchStr 6 12 CONNECT 9600
MatchStr 7 33 NO DIAL
MatchStr 8 27 NO ANSWER
MatchStr 9 33 VOICE
MatchStr 10 33 CARRIER
!
!Changed 9/19/89 by DMC to report busy signals as a seperate error (label 26)
MatchStr 11 26 BUSY
!
MatchStr 12 33 ERROR
!
SetTries 0
CanBtn 18 { if cancel button hit, hangUp then exit }
Pause 30
Xmit AT~MSTR D~TONE~FONE\13
! { jump to label #13 if match }
Wait 2400 { wait 30 seconds for CONNECT msg from modem }
!
!
MatchStr 1 7 2400 {We'll couldn't match, But maybe were using an MNP modem.}
MatchStr 2 8 4800 {We could encounter some confusion with number dialed here.}
MatchStr 3 9 9600 {Dont check for 300,1200 due to this confusion.}
! {Plus MNP modems may talk at a higher baud rate then there connect at.}
!
Wait 30
Jump 27 { else hang up phone & exit }
!
!----------------------------------------------------------------------
!
-Label 5
SerReset 300 0 8 1
Pause 20
FLUSH
Jump 12
!
!
-Label 6
SerReset 1200 0 8 1
Pause 20
FLUSH
Jump 12
!
!
-Label 7
SerReset 2400 0 8 1
Pause 20
FLUSH
Jump 12
!
-Label 8
SerReset 4800 0 8 1
Pause 20
FLUSH
Jump 12
!
-Label 9
SerReset 9600 0 8 1
Pause 20
FLUSH
Jump 12
!
!
!
!
!----------------------------------------------------------------------
!
-LABEL 12 { Modem just sent 'CONNECT' message }
DsplyPic 2
Pause 60 { Need some dead time. }
ChrDelay 20
!
!
-LABEL 13 { Establishing Connection }
MatchStr 1 15 DATAPAC:
!
Xmit ..\13
Wait 240 {Try to sync up to four times}
IncTries
IfTries 4 32
Jump 13
!
!----------------------------------------------------------------------
!
-LABEL 15 Sending Identifier
!
!
ChrDelay 2
MatchStr 1 16 CALL CONNECTED
MatchStr 2 17 PACKET SIZE:
Xmit ~DPC1\13
!
Wait 960
Jump 32
!
-LABEL 16
MatchStr 1 17 PACKET SIZE:
Wait 960 {Pause for datapac to finish.}
!
!----------------------------------------------------------------------
!
!----------------------------------------------------------------------
!
-LABEL 17 { System Ready ... All is well }
Pause 60
Exit 0
!
!----------------------------------------------------------------------
!
-Label 18 { User aborted sequence }
Hangup
Exit -111
!
-Label 19 { User aborted sequence...dont need to hang up thou}
Exit -111
!
!----------------------------------------------------------------------
!
-Label 26 {Busy phone}
Talert All phone lines are currently busy. \13Please wait a few minutes and try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 27 {No Answer}
Talert There is no answer from the access company (Error # 3).\13Verify the access number and try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 28 {Noisy line}
Talert There is noise on your phone line (Error # 16).\13Please try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 29 {acct bad}
Talert Unable to verify account information (Error # 22).\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 30 {disk problem}
Talert There was an error in reading your ~APPL disk (Error # 0).Please try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 31 {acct aleady on}
Talert Please wait a few minutes and try again (Error # 23).\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 32 {not_avail}
Talert ~APPL is not available at the moment (Error # 20).\13Please wait a few minutes and try again.\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 33 {generic}
Talert Unable to initialize modem (Error # 1). Please take the following steps:\13\13 1) Turn your modem off, then back on.\13 2) Verify the access number.\13 3) Make sure that your modem and phone line are connected correctly.\13 4) Try again.
Jump 36
!
!----------------------------------------------------------------------
!
-Label 34 {db_error}
Talert There is a bad ~APPL file on your disk (Error # 0).\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 35
Exit -1
!
!----------------------------------------------------------------------
!
-Label 36
Alert 35 \13If the problem persists, call ~APPL customer service at ~ACUS.
Exit -1
!
!----------------------------------------------------------------------
!
*-Label 0 {Hangup Sequence}
*CanBtn 2
*ChrDelay 2
!
*Flush
!
*MatchStr 1 1 OK { Dont look for an echo first time, maybe a}
*MatchStr 2 1 NO { false echo. Any type of match is good}
*MatchStr 3 1 > { Special case for Avatex 1200 modems}
!
*Xmit +++ {Try and get the modems attention}
*Wait 210
!
*MatchStr 1 1 OK
*MatchStr 2 2 CARRIER {Any type of match is good}
*MatchStr 3 1 +++
*MatchStr 4 1 > { Special case for Avatex 1200 modems}
!
*Xmit +++ {Double our odds}
*Wait 210
!
*-Label 1
*MatchStr 1 2 ERROR
*MatchStr 2 2 OK
*MatchStr 3 2 CARRIER
*MatchStr 4 2 > { Special case for Avatex 1200 modems}
!
*Pause 40
*Xmit AT H\13
*Wait 300
!
*-Label 2
*Exit 0
!
###